import Vue from "vue";
import ComponentTemplate from "./index.vue";
const VueComponent = Vue.extend(ComponentTemplate);

export const selecteTable = (option: any) => {
    const vm: any = new VueComponent().$mount();
    vm.selectedList = option.selectedList || [];
    vm.isSingle = option.isSingle || false;
    vm.title = option.title || "";
    vm.columnList = option.columnList || [];
    vm.$on("getOptions", (item: any) => {
        if (option && option.getOptions) option.getOptions(vm, item);
    });
    vm.$on("sure", (model: any) => {
        if (option && option.sure) option.sure(vm, model);
    });
    vm.$on("close", (model: any) => {
        if (option && option.close) option.close(vm, model);
    });
    vm.show = true;
    return vm;
};
